#Copyright (c) 2025, Alibaba Cloud and its affiliates;
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at

#   http://www.apache.org/licenses/LICENSE-2.0

#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.



from enum import Enum

HEAD_GROUP = "head"
WORKER_GROUP = "worker"

FCE_TOOLS = ['kubectl', 'helm', 'operator']
OPERATOR_NAME_PREFIX = "kuberay-operator"
FCE_HOME = "/usr/local/fce"
FCE_UTIL_HOME = "/usr/local/fce/bin"
FCE_BIN_PATH = "/usr/local/bin"
FCE_VERSION_DEFAULT = "1.0"
OPERATOR_INSTALL_SCRIPT = "kuberay_operator_install.sh"
OPERATOR_UNINSTALL_SCRIPT = "kuberay_operator_uninstall.sh"
KUBE_OPERATOR_DIR = "/usr/local/fce/kuberay-operator"
KUBE_OPERATOR_NAME = "kuberay-operator"
KUBE_CONFIG_DEFAULT_PATH = "/root/.kube/config"
KUBE_NAMESPACE_DEFAULT = "default"

head_node_config = {
    "Image": "rayproject/ray:2.31.0",
    "Cpu": 2,
    "Memory": 4,
    "NodeAffinity": [],
}

worker_node_config = [
    {
        "Image": "rayproject/ray:2.31.0",
        "Cpu": 4,
        "Memory": 8,
        "Replicas": 2,
        "GroupName": "workergroup",
        "NodeAffinity": []
    },
]

class Tools(Enum):
    """
    Deploy tools
    """
    KUBECTL = 'kubectl'
    HELM = 'helm'

class GlobalConfig:
    def __init__(self, region_id):
        self.ecs_api_endpoint = f"https://ecs-vpc.{region_id}.aliyuncs.com"
        self.ecs_api_endpoint2 = f"ecs-vpc.{region_id}.aliyuncs.com"
        self.ecs_api_version = '2014-05-26'